package cn.smile.controller.basic;

import cn.smile.bean.dto.basic.DayDataCountDTO;
import cn.smile.business.basic.IDataCountService;
import cn.smile.commons.response.MyResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/dataCount")
public class DataCountController {
    @Resource
    private IDataCountService service;

    @GetMapping(value = "countShopDataByDay")
    public MyResult<DayDataCountDTO> countShopDataByDay(@RequestParam("date") String date) {
        return MyResult.OK(service.countShopDataByDay(date));
    }

    @GetMapping(value = "countShopDataByMonth")
    public MyResult<DayDataCountDTO> countShopDataByMonth(@RequestParam("date") String date) {
        return MyResult.OK(service.countShopDataByMonth(date));
    }
}
